Skip to content

feat(langchain): preserve owned-client authentication and Store cleanup - #7039

Draft
ehz0ah wants to merge 2 commits into
volcengine:mainfrom
ehz0ah:consolidate/langchain-clients-20261104
Draft

ehz0ah wants to merge 2 commits into
volcengine:mainfrom
ehz0ah:consolidate/langchain-clients-20261104

Conversation

@ehz0ah

@ehz0ah ehz0ah commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Description

Owned adapter clients cannot select API-key authentication independently of ambient LDAP/OIDC settings. Store cleanup can also return while a cancelled initialization or safe-read retry later opens an owned transport. This change forwards an explicit auth_mode through owned sync/async clients, copies and safe-read recovery, and drains active Store requests during cleanup.

An API-key-only client keeps its configured mode after recovery. Store cleanup rejects new backend requests, drains active requests, and releases only owned transports. Cancelled initialization and safe-read recovery cannot leave a replacement transport open after context exit. Concurrent Store reads remain concurrent; injected clients remain caller-owned.

Cherry-picks #6614 with its original author identity, date and source SHA retained. The Store lifecycle API from #6968 has already merged into main as 02611de; its duplicate cherry-pick was dropped during rebase. The cancellation/drain repair and its two deterministic SDK regression cases remain a separate commit. Unset auth_mode retains existing SDK defaults. The SDK minimum is 0.1.7, the first version exposing the explicit mode.

Related to #6612 and #6964. Follows up merged #6968.

Validation against upstream f7b726f: 820 passed on Python 3.12/current frameworks; 818 passed with 2 expected skips on Python 3.10/framework 1.0.0. The combined three-branch candidate passes 916 tests on Python 3.12 and 914 with 2 skips on Python 3.10. Ruff lint/format, mypy on 15 source modules, git diff --check, wheel/sdist builds and Twine checks pass. The combined package and SDK source remain byte-identical to the prior candidate that passed clean installed-wheel checks with published SDKs 0.1.7 and 0.1.18.

Companion drafts: #7038 (Store contracts) and #7040 (archive queries). The combined candidate retains both the Store contract fixes and cleanup draining.

Cleanup drains active backend requests; a multi-request Store operation can be interrupted between requests. It adds no transaction or rollback mechanism.

Contributors: Xinmin Zeng for the auth-mode change and stefanielizeth73-art for the already merged Store lifecycle proposal. The #6614 commit keeps its original author identity and date. Hao Zhe authored the separate cleanup repair and is the committer of the cherry-pick.

Landing: preserve these commits through a merge/rebase merge. If squashing is required, retain all contributor credit explicitly in the squash commit. Original PRs should be marked covered after the accepted consolidated change lands.

Human Involvement

  • A human participated in the implementation or review loop
  • This PR was generated entirely by AI agents without human participation in the loop

Type of Change

  • Bug fix
  • New feature
  • Test update
  • Documentation update

Checklist

  • Final diff reviewed
  • New and existing local tests pass
  • Package build and installed-wheel checks pass

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants